package com.stylefeng.guns.modular.system.model;

import com.baomidou.mybatisplus.activerecord.Model;
import com.baomidou.mybatisplus.annotations.TableField;
import com.baomidou.mybatisplus.annotations.TableId;
import com.baomidou.mybatisplus.annotations.TableName;
import com.baomidou.mybatisplus.enums.IdType;
import org.springframework.format.annotation.DateTimeFormat;

import java.io.Serializable;
import java.util.Date;

/**
 * <p>
 * 
 * </p>
 *
 * @author stylefeng123
 * @since 2018-07-04
 */
@TableName("borrowing_info")
public class BorrowingInfo extends Model<BorrowingInfo> {

    private static final long serialVersionUID = 1L;

    /**
     * 主键id
     */
    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;
    /**
     * 借入借出归还类型（1-应收，2-应付）
     */
    private Integer type;
    /**
     * 往来明细ID
     */
    private String contact;

    /**
     * 披索金额
     */
    @TableField("piso_amount")
    private Double pisoAmount;
    /**
     * 人民币金额
     */
    @TableField("rmb_amount")
    private Double rmbAmount;

    /**
     * 订单号
     */
    @TableField("order_number")
    private String orderNumber;
    /**
     * piso折人民币
     */
    @TableField("piso_to_rmb")
    private Double pisoToRmb;
    /**
     * 应收应入余额
     */
    private Double balance;
    /**
     * 成本项
     */
    private int cost;
    /**
     * 平台编号
     */
    private String platform;
    /**
     * 摘要
     */
    private String note;
    /**
     * 报表统计日期
     */
    @TableField("rev_date")
    @DateTimeFormat(pattern="yyyy-MM-dd")
    private Date revDate;
    /**
     * 创建时间
     */
    private Date creattime;
    /**
     * 更新时间
     */
    private Date updatetime;


    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public Integer getType() {
        return type;
    }

    public void setType(Integer type) {
        this.type = type;
    }

    public static long getSerialVersionUID() {
        return serialVersionUID;
    }

    public String getContact() {
        return contact;
    }

    public void setContact(String contact) {
        this.contact = contact;
    }

    public Double getPisoAmount() {
        return pisoAmount;
    }

    public void setPisoAmount(Double pisoAmount) {
        this.pisoAmount = pisoAmount;
    }

    public Double getRmbAmount() {
        return rmbAmount;
    }

    public void setRmbAmount(Double rmbAmount) {
        this.rmbAmount = rmbAmount;
    }

    public Double getPisoToRmb() {
        return pisoToRmb;
    }

    public void setPisoToRmb(Double pisoToRmb) {
        this.pisoToRmb = pisoToRmb;
    }

    public Double getBalance() {
        return balance;
    }

    public void setBalance(Double balance) {
        this.balance = balance;
    }

    public String getPlatform() {
        return platform;
    }

    public void setPlatform(String platform) {
        this.platform = platform;
    }

    public String getNote() {
        return note;
    }

    public void setNote(String note) {
        this.note = note;
    }

    public Date getRevDate() {
        return revDate;
    }

    public void setRevDate(Date revDate) {
        this.revDate = revDate;
    }

    public Date getCreattime() {
        return creattime;
    }

    public void setCreattime(Date creattime) {
        this.creattime = creattime;
    }

    public Date getUpdatetime() {
        return updatetime;
    }

    public void setUpdatetime(Date updatetime) {
        this.updatetime = updatetime;
    }

    public String getOrderNumber() {
        return orderNumber;
    }

    public void setOrderNumber(String orderNumber) {
        this.orderNumber = orderNumber;
    }


    public int getCost() {
        return cost;
    }

    public void setCost(int cost) {
        this.cost = cost;
    }

    @Override
    protected Serializable pkVal() {
        return this.id;
    }

    @Override
    public String toString() {
        return "BorrowingInfo{" +
        "id=" + id +
        ", type=" + type +
        ", contact=" + contact +
        ", cost=" + cost +
        ", pisoAmount=" + pisoAmount +
        ", rmbAmount=" + rmbAmount +
        ", pisoToRmb=" + pisoToRmb +
        ", balance=" + balance +
        ", platform=" + platform +
        ", note=" + note +
        ", revDate=" + revDate +
        ", creattime=" + creattime +
        ", updatetime=" + updatetime +
        "}";
    }


    public static enum Enum_Type {
        //借入借出归还类型（1-借款，2-还款）
        应收(1, "应收"), 应付(2, "应付");
        public Integer value;
        public String desc;

        private Enum_Type(Integer _Value, String _Desc) {
            this.value = _Value;
            this.desc = _Desc;
        }
    }

    public static enum Enum_Cost {
        //借入借出归还类型（1-借款，2-还款）
        工资薪酬(1, "工资薪酬"), 食堂及补助(3, "食堂及补助"), 房租费用(4, "房租费用"), 水费(5, "水费"), 电费(6, "电费"),线路费用(33,"线路费用")
        , 网络费用(7, "网络费用"), 机票费用(8, "机票费用"), 签证及保关费用(9, "签证及保关费用"), 办公费用(10, "办公费用"), 其他杂费(11, "其他杂费");
        public int value;
        public String desc;

        private Enum_Cost(int _Value, String _Desc) {
            this.value = _Value;
            this.desc = _Desc;
        }
    }
    public static String getType(Integer _Value){
        Enum_Type[] enum_types = Enum_Type.values();
        for (int i=0;i<enum_types.length;i++){
            if (enum_types[i].value==_Value)
                return enum_types[i].desc;
        }
        return null;
    }
}
